//package com.fast.ThreadPoolFactory;
//
//import cn.hutool.core.thread.NamedThreadFactory;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.stereotype.Component;
//
//import java.util.concurrent.*;
//
///**
// * @author hjw
// * @since 2022年07月17日 16:33:00
// */
//@Component
//public class ThreadPoolFactoryCompletable {
//
//    @Bean(destroyMethod = "shutdown")
//    public ThreadPoolExecutor coreThreadPool() {
//        return new ThreadPoolExecutor(
//                Runtime.getRuntime().availableProcessors() * 2,
//                Runtime.getRuntime().availableProcessors() * 2,
//                60,
//                TimeUnit.SECONDS,
//                new ArrayBlockingQueue<>(300),
//                new NamedThreadFactory("core_thread_pool_",true),
//                new ThreadPoolExecutor.AbortPolicy()
//        );
//    }
//
//    @Bean
//    public <R> CompletionService<R> abandonCompletionService(@Qualifier(value = "abandonThreadPool") ThreadPoolExecutor threadPoolExecutor) {
//        return new ExecutorCompletionService<>(threadPoolExecutor);
//    }
//
//
//}
